//组合类的初始化
#include <iostream>
using namespace std;

//point类
class Point //点类，用两个坐标描述
{
private:
  int x, y;

public:
  Point(int a, int b) //构造函数，带两个整型参数
  {
    x = a;
    y = b;
    cout << "Point 构造函数 1(" << x << "," << y << ")" << endl;
  };
  Point(Point &A)
  {
    x = A.x;
    y = A.y;
    cout << "Point 构造函数 2(" << x << "," << y << ")" << endl;
  }
  void show()
  {
    cout << "Point (" << x << "," << y << ")" << endl;
  }
};

//Rectangle类
class Rectangle
{
private:
  Point lefttop;
  Point rightbottom;

public:
  //构造函数，使用四个整数初始化
  Rectangle(int x1, int y1, int x2, int y2) : rightbottom(x2, y2), lefttop(x1, y1)
  {
    cout << "Rectangle构造函数1" << endl;
  }:
    //构造函数，使用Point对象初始化
    Rectangle(Point A, Point B):rightbottom(B), lefttop(A)
  {
    cout << "Rectangle构造函数2" << endl;
  }
  //显示举行的坐标点
  void show()
  {
    cout << "Rectangle\n";
    lefttop.show();
    rightbottom.show();
  }
};

int main()
{
  int x1 = 1, y1 = 2, x2 = 3, y2 = 4;
  Point A(11, 12), B(13, 14);
  Rectangle left(x1, y1, x2, y2), right(A, B);

  cout << "rectangle left\n";
  left.show();
  cout << "rectangle right\n";
  right.show()

  return 0;
}
